<style type="text/css">
    .text-center a:hover{
        text-decoration: none;
    }
    .num{
        position: relative;
        float: left;
        padding: 6px 12px;
        line-height: 1.5;
        text-decoration: none;
        color: #009a61;
        background-color: #fff;
        border: 1px solid #ddd;
        margin-left: -1px;
    }

    .current{
        position: relative;
        float: left;
        padding: 6px 12px;
        line-height: 1.5;
        text-decoration: none;
        color: #009a61;
        background-color: #fff;
        border: 1px solid #ddd;
        margin-left: -1px;
        z-index: 2;
        color: #fff;
        background-color: #009a61;
        border-color: #009a61;
        cursor: default;
    }

    .prev{
        position: relative;
        float: left;
        padding: 6px 12px;
        line-height: 1.5;
        text-decoration: none;
        color: #009a61;
        background-color: #fff;
        border: 1px solid #ddd;
        margin-left: -1px;
    }

    .next{
        position: relative;
        float: left;
        padding: 6px 12px;
        line-height: 1.5;
        text-decoration: none;
        color: #009a61;
        background-color: #fff;
        border: 1px solid #ddd;
        margin-left: -1px;
    }


</style>
<div class="profile">
    <header class="profile__heading">
        <div class="container">
            <div class="row">
                <div class="col-md-2">
                    <a class="text-left" href="/u/harmon">
                        <if condition="empty($userdata[0]['face'])">
                            <img class="avatar-128 profile__heading--avatar" src="https://sf-static.b0.upaiyun.com/v-576b52d9/global/img/user-256.png" alt="harmon">
                        <else/>

                            <img class="avatar-128 profile__heading--avatar" src="__ROOT__/<?php echo $userdata[0]['face'] ?>" alt="harmon">
                        
                        </if>
                    </a>
                </div>
                <div class="col-md-7">
                    <h2 class="profile__heading--name">{$userdata[0]['username']}</h2>
                    <div class="profile__heading--desc js-show">
                        {$userdata[0]['signnature']}
                    </div>
                    <div class="profile__heading--social"></div>
                </div>
                
                <if condition="$_SESSION['uid'] eq $_GET['uid']">
                   <!-- 显示访问自己的主页 -->
                   <div class="col-md-3">
                        <div class="mt10">
                            <a class="btn mr10 btn-warning" href="{:U('home/User/userinfo')}" data-id="1030000005791058">编辑资料</a>
                            <a href="/u/harmon/profile" class="btn btn-default"><i class="fa fa-user"></i> 创建档案</a>
                        </div>
                        <div class="profile__heading-info row">
                            <div class="col-md-4 col-xs-4">
                                <a href="/u/harmon/rank"><span class="h3">0</span><span>声望值</span></a>
                            </div>
                            <div class="col-xs-4">
                                <span class="h3">0</span>
                                <span>被赞数</span>
                            </div>
                            <div class="col-xs-4">
                                <a href="/u/harmon/users/followed"><span class="h3">0</span><span>个粉丝</span></a>
                            </div>
                        </div>
                    </div>
                    <!-- 显示访问自己的主页end --> 
                <else/>
                    <!-- 显示访问别的用户 -->
                    <div class="col-md-3">
                        <div class="mt10">
                            <a class="btn mr10 btn-success userfollow" data-id="1030000005747479"> 加关注 </a>
                            <a class="btn btn-default mr10" href="javascript:void(0);" id="courier" data-username="alwaysmy" data-userid="1030000005747479"><i class="fa fa-commenting-o"></i></a>
                        </div>
                        <div class="profile__heading-info row">
                            <div class="col-md-4 col-xs-4">
                                <a href="/u/alwaysmy/rank"><span class="h3">2</span><span>声望值</span></a>
                            </div>
                            <div class="col-xs-4">
                                <span class="h3">0</span>
                                <span>被赞数</span>
                            </div>
                            <div class="col-xs-4">
                                <a href="/u/alwaysmy/users/followed"><span class="h3">0</span><span>个粉丝</span></a>
                            </div>
                        </div>
                   </div>
                  <!-- 显示访问别的用户end -->
                </if>
                            
        

              


            </div>
        </div>
    </header>
    <div class="wrap mt30">
        <div class="container">
            <div class="row">
                <div class="col-md-2">
                    <ul class="nav nav-pills nav-stacked profile__nav">
                        <!-- 如果看的是自己的主页的话 -->
                        <if condition="$_SESSION['uid'] eq $_GET['uid']">
                            <li ><a href="{:U('home/user/userhome',array('uid'=>$_GET['uid']))}"><span>我的主页</span></a></li>
                            <li class="active"><a href="{:U('home/user/useranswer',array('uid'=>$_GET['uid']))}"><span>我的回答</span><span class="count"> 80</span></a></li>
                            <li><a href="/u/harmon/questions"><span>我的提问</span><span class="count"></span></a></li>
                            <li><a href="/u/harmon/articles"><span>我的文章</span><span class="count"></span></a></li>
                            <li><a href="/u/harmon/notes"><span>我的笔记</span><span class="count"></span></a></li>
                            <li><a href="/u/harmon/bookmarks"><span>我的收藏夹</span><span class="count"></span></a></li>
                        <!-- 如果不是的话 -->
                        <else/>
                            <li ><a href="{:U('home/user/userhome',array('uid'=>$_GET['uid']))}"><span>他的主页</span></a></li>
                            <li class="active"><a href="{:U('home/user/useranswer',array('uid'=>$_GET['uid']))}"><span>他的回答</span><span class="count"> 80</span></a></li>
                            <li><a href="/u/harmon/questions"><span>他的提问</span><span class="count"></span></a></li>
                            <li><a href="/u/harmon/articles"><span>他的文章</span><span class="count"></span></a></li>
                            <li><a href="/u/harmon/notes"><span>他的笔记</span><span class="count"></span></a></li>
                            <li><a href="/u/harmon/bookmarks"><span>他的收藏夹</span><span class="count"></span></a></li>
                        </if>

                            <li role="separator" class="divider"><a></a></li>
                            
                            <if condition="$_SESSION['uid'] eq $_GET['uid']">
                                <li><a href="/u/harmon/questions/following"><span>我关注的</span></a></li>
                            </if>
                            <li><a href="/u/harmon/tags"><span>标签得分</span></a></li>
                            <li><a href="/u/harmon/badges"><span>获得徽章</span><span class="count"> 1</span></a></li>
                            <li><a href="/u/harmon/rank"><span>声望记录</span></a></li>
                    </ul>
                </div>
                <div class="col-md-10 profile-mine">
                    <h4 class="profile-mine__heading">
                         <if condition="$_SESSION['uid'] eq $_GET['uid']">
                            <span>我的回答</span>
                        <else />
                            <span>他的回答</span>
                        </if>
                        <div class="pull-right profile-mine__heading--filter">
                            <span>排序: </span>
                            <div class="btn-group btn-group-xs">
                                <a class="btn btn-default active " href="/u/yangbo/answers?sort=created" role="button">时间</a>
                                <a class="btn btn-default  " href="/u/yangbo/answers?sort=vote" role="button">投票</a>
                            </div>
                        </div>
                    </h4>
                    <ul class="profile-mine__content">
                        <?php
                            foreach ($userAnswerRes as $key => $value) {
                                ?>
                                    <li>
                                        <div class="row">
                                            <div class="col-md-1">
                                                <span class="label label-warning  "><?php echo $value['vote_num'] ?>投票</span>
                                            </div>
                                            <div class="col-md-9 profile-mine__content--title-warp">
                                                <a class="profile-mine__content--title" href="{:U('home/Blogs/bloginfo',array('qid'=>$value['qid']))}"><?php echo $value['title'] ?></a>
                                            </div>
                                            <div class="col-md-2">
                                                <span class="profile-mine__content--date">1 天前</span>
                                            </div>
                                        </div>
                                    </li>
                                <?php 
                            }
                        ?>
                            
                    </ul>

                    <div class="text-center">
                        <ul class="pagination">
                            <?php echo $Page ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
